package com.dbpms.pj.sys.dao;

import com.dbpms.pj.common.pojo.CheckBox;
import com.dbpms.pj.sys.pojo.SysRole;
import com.dbpms.pj.sys.pojo.SysRoleMenu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: Song Yu
 * @Date: 2020/10/20 9:49
 */

@Mapper
public interface SysRoleDao {

    int getRowCount(String name);

    List<SysRole> findPageObjects(String  name,Integer startIndex,Integer pageSize);

    @Delete("delete from sys_roles where id=#{id}")
    int deleteObject(Integer id);

    int insertObject(SysRole entity);

    SysRoleMenu findById(Integer id);

    int updateObject(SysRole entity);

    @Select("select id,name from sys_roles")
    List<CheckBox> findObjcets();
}
